<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
    <meta name="csrf-token" content="{{csrf_token()}}">
    <!-- Libs CSS -->
    <link rel="stylesheet" href="{{asset('org/Dashkit-1.2.0')}}/fonts/feather/feather.min.css">
    <link rel="stylesheet" href="{{asset('org/Dashkit-1.2.0')}}/libs/highlight/styles/vs2015.min.css">
    <link rel="stylesheet" href="{{asset('org/Dashkit-1.2.0')}}/libs/quill/dist/quill.core.css">
    <link rel="stylesheet" href="{{asset('org/Dashkit-1.2.0')}}/libs/select2/dist/css/select2.min.css">
    <link rel="stylesheet" href="{{asset('org/Dashkit-1.2.0')}}/libs/flatpickr/dist/flatpickr.min.css">
    <!-- Theme CSS -->
    <!-- Values are "toggle", "light", and "dark". See "Getting Started" for more information -->
    <!-- Toggle Mode: For demo only, but allows a user to seamlessly toggle between light/dark modes -->

    <link href="{{asset('org/Dashkit-1.2.0')}}/css/theme-dark.min.css" rel="" data-toggle="theme"
          data-theme-mode="dark">
    <link href="{{asset('org/Dashkit-1.2.0')}}/css/theme.min.css" rel="" data-toggle="theme" data-theme-mode="light">

    <style>
        body {
            display: block;
        }
    </style>

    <script>
        var themeMode = (localStorage.getItem('dashkitThemeMode')) ? localStorage.getItem('dashkitThemeMode') : 'light';
        var themeFile = document.querySelector('[data-toggle="theme"][data-theme-mode="' + themeMode + '"]');

        // Enable stylesheet
        themeFile.rel = 'stylesheet';

        // Enable body content
        themeFile.addEventListener('load', function () {
            document.body.style.display = 'block';
        });
    </script>

    <title>Dashkit</title>
    @include('layouts._hdjs')
    @include('layouts._message2')@stack('css')
</head>
<body>

<!-- TOPNAV
================================================== -->
<nav class="navbar navbar-expand-lg navbar-light">
    <div class="container">

        <!-- Toggler -->
        <button class="navbar-toggler mr-auto" type="button" data-toggle="collapse" data-target="#navbar"
                aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>


        <!-- User -->
        <div class="navbar-user">

            <!-- Dropdown -->
            <!-- Dropdown -->
            @auth
                <div class="dropdown">
                    <!-- Toggle -->
                    <a href="#" class="avatar avatar-sm avatar-online dropdown-toggle" role="button"
                       data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                        <img src="{{auth()->user()->icon}}" alt="..."
                             class="avatar-img rounded-circle">
                    </a>

                    <!-- Menu -->
                    <div class="dropdown-menu dropdown-menu-right">
                        @can('Admin-module')
                            <a href="{{route('admin.module.index')}}" class="dropdown-item">后台管理</a>
                        @endcan
                        <a href="{{route('user.info.edit','password')}}" class="dropdown-item">修改密码</a>
                        <a href="{{route('user.info.edit','icon')}}" class="dropdown-item">更新头像</a>
                        <a href="settings.html" class="dropdown-item">粉丝列表</a>
                        <a href="settings.html" class="dropdown-item">课程收藏</a>
                        <a href="settings.html" class="dropdown-item">学习记录</a>
                        <hr class="dropdown-divider">
                        <a href="{{route('logout')}}" class="dropdown-item">退出</a>
                    </div>
                </div>
            @else
                <div class="dropdown">
                    <a href="{{route('login')}}" class="btn btn-white btn-sm">
                        <span class="fe fe-user-check"></span> 登录
                    </a>
                    <a href="{{route('register')}}" class="btn btn-white btn-sm">
                        <span class="fe fe-log-out"></span>注册
                    </a>
                </div>
            @endauth
        </div>
        <!-- Collapse -->
        <div class="collapse navbar-collapse mr-auto order-lg-first" id="navbar">
            <!-- Form -->
            <form class="mt-4 mb-3 d-md-none">
                <input type="search" class="form-control form-control-rounded" placeholder="Search" aria-label="Search">
            </form>
            <!-- Navigation -->
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link mr-3" href="{{route('admin.module.index')}}">
                        <img src="{{asset('org/Dashkit-1.2.0/img')}}/logo.jpg" alt="..." class="navbar-brand-img">
                    </a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<div class="container">
    <div class="main-content mt-5">
        <div class="row">
            <div class="col-3">
                <div class="card">
                    <div class="card-body  text-center">
                        <div class="avatar avatar-xxl">
                            <a href="{{route('user.info.edit',['id'=>'icon'])}}">
                                <img src="{{auth()->user()->icon}}" alt="..." class="avatar-img rounded-circle">
                            </a>
                        </div>
                        <h3 class="mt-3 text-secondary">{{auth()->user()->name}}</h3>
                    </div>
                </div>
                <div class="card">
                    <ul class="list-group">
                        <a href="{{route('user.info.edit','password')}}" class="list-group-item text-secondary">修改密码</a>
                        <a href="{{route('user.info.edit','password')}}"
                           class="list-group-item text-secondary">修改资料</a>
                        @foreach(center_menus() as $menus)
                            {{--$menus如果为真就表示$menus中有内容,否则没有内容,没有内容就不需要展示--}}
                            @if($menus)
                                @foreach($menus as $menu)
                        <a href="{{$menu['route']}}"
                           class="list-group-item text-secondary">{{$menu['name']}}</a>
                                @endforeach
                            @endif
                            @endforeach
                    </ul>
                </div>
            </div>
            <div class="col-9">
                @yield('content')
            </div>
        </div>
    </div>
</div>
@stack('js')
</body>
</html>